package com.jxc.action;

import java.io.IOException;
import java.util.List;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;


import com.jxc.model.po.Serial;
import com.jxc.model.vo.VSerial;
import com.jxc.service.SerialService;
import com.jxc.util.SerialUtils;
import com.opensymphony.xwork2.ModelDriven;

/**
 * 专门生成单号的ACTION
 * 
 * @author Tino
 * 
 */
@Namespace("/")
@Action("serial")
public class SerialAction extends BaseAction implements ModelDriven<VSerial>  {
	private String sign;
	@Autowired
	private SerialService dao;
	private VSerial model = new VSerial();
	public void noAuth_serial() throws IOException{
		ServletActionContext.getResponse().setContentType("text/html;charset=utf-8");
		ServletActionContext.getResponse().getWriter().write(dao.getAll(model));
		ServletActionContext.getResponse().getWriter().flush();
		ServletActionContext.getResponse().getWriter().close();
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	@Override
	public VSerial getModel() {
		return model;
	}

}
